import requests
url='https://www.chinanews.com.cn/'
headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36'}
response=requests.get(url,headers=headers)
response.encoding='utf-8'
# print(response.text)

from bs4 import BeautifulSoup
soup=BeautifulSoup(response.text,'lxml')
tags = soup.select('div.module_topcon_ul a')
all_news=[]
for i in tags:
    title=i.get_text().strip()
    link=i.get('href')
    news={'title':title,'link':link}
    print(news)
    all_news.append(news)

import pandas as pd
df=pd.DataFrame(all_news)
df.to_csv('中国新闻网实时新闻.csv',index=False,encoding='utf-8-sig')